package datatype

import (
	"log"
	"fmt"
	"reflect"
)

func init()  {
	log.SetPrefix("MyLog:")
	log.SetFlags(log.Ldate | log.Lmicroseconds | log.Llongfile)
}

func main(){
	// go语言中是如何处理单个字符和字符串的呢？
	var sharp uint8 ='#'
	runeType :='#'
	var n int =35
	var by byte = 12
	_ = by
	_ = n
	sharpStr :="#"
	str:="我china"
	fmt.Println(sharp)
	fmt.Println(runeType)
	fmt.Println(35 == sharp)
	fmt.Println(35 == runeType)

	// 类型不相符，但是数值35默认就是哪个数值
	// byte和unit是等价吗
    fmt.Println(by == sharp)
	// fmt.Println(n == sharp)
	// fmt.Println(n == runeType)
	fmt.Println(reflect.TypeOf(sharp))
	fmt.Println(reflect.TypeOf(runeType))
	fmt.Println(reflect.TypeOf(sharpStr))
	fmt.Println(reflect.TypeOf(str[0]))
	fmt.Println(str[0])
	fmt.Println(reflect.TypeOf(str[2]))
	logTs()
}
func logTs()  {
	log.Println("message")
	//os.Exit(1)
	log.Fatal("fatal message")

}
